﻿using System;
using System.Collections.Generic;
using System.Text;

namespace Utility
{
    public class Generate
    {
        private const string chars = "a1bA2cB3dC4eD5fE6gF7hG8H9kK1NnUuVvXxYyZz";
        public static string GenerateRandomCode(int NumberOfKeys)
        {
            Random random = new Random((int)DateTime.Now.Ticks);
            int charLength = chars.Length;
            StringBuilder sb = new StringBuilder();
            for (int i = 0; i < NumberOfKeys; i++)
            {
                int idx = random.Next(0, charLength);
                sb.Append(chars.Substring(idx, 1));
            }
            return sb.ToString();
        }
    }
}
